# Makefile for all tests

CXX = g++
CXXFLAGS = -Wall -ansi -pedantic

LDFLAGS = -L/usr/X11R6/lib64
LIBS = -lGL -lGLU -lglut

TARGETS = test_Log test_Image test_Texture test_Timer \
    test_Application
#    test_GLWindow 

.PHONY: all clean

all: $(TARGETS)

test_Log: test_Log.o ../Log.o
	$(CXX) -o test_Log test_Log.o ../Log.o 

test_Log.o: test_Log.cpp ../Log.h
	$(CXX) $(CXXFLAGS) -c test_Log.cpp

test_Image: test_Image.o ../Image.o ../Log.o
	$(CXX) -o test_Image test_Image.o ../Image.o ../Log.o \
		-L/usr/X11R6/lib64 -lglut -lGL -lGLU

test_Image.o: test_Image.cpp ../Image.h ../Log.h
	$(CXX) $(CXXFLAGS) -c test_Image.cpp

test_Texture: test_Texture.o ../Texture.o ../Image.o ../Log.o
	$(CXX) -o test_Texture test_Texture.o ../Texture.o ../Image.o ../Log.o \
		-L/usr/X11R6/lib64 -lglut -lGL -lGLU

test_Texture.o: test_Texture.cpp ../Texture.h
	$(CXX) $(CXXFLAGS) -c test_Texture.cpp

test_GLWindow: test_GLWindow.o ../GLWindow.o ../Application.o ../Log.o ../Controller.o ../Timer.o
	$(CXX) -o test_GLWindow test_GLWindow.o ../GLWindow.o ../Application.o ../Log.o ../Controller.o ../Timer.o \
		-I/usr/X11R6/include -L/usr/X11R6/lib64 -lGL -lGLU -lXmu -lXext -lX11

test_GLWindow.o: test_GLWindow.cpp ../GLWindow.h ../Log.h ../Controller.h
	$(CXX) $(CXXFLAGS) -c test_GLWindow.cpp

test_Timer: test_Timer.cpp ../Timer.o ../Log.o
	$(CXX) $(CXXFLAGS) -o test_Timer test_Timer.cpp ../Timer.o ../Log.o

test_Application: test_Application.cpp ../Application.o ../Timer.o ../Log.o ../GLWindow.o ../Controller.o
	$(CXX) $(CXXFLAGS) -o test_Application test_Application.cpp \
		../Application.o ../Timer.o ../Log.o ../GLWindow.o ../Controller.o \
		-I/usr/X11R6/include -L/usr/X11R6/lib64 -lGL -lGLU -lXext -lX11 -lXxf86vm

clean:
	$(RM) -v $(TARGETS) *.o
